<template>
  <view>

    <u-search searchIconSize="50" height="70" placeholder="请输入搜索关键词" v-model="word" @change="change"></u-search>
     <secarchLIst :words="searchWords"></secarchLIst>
  </view>
</template>

<script>
  export default {
    data() {
      return {
        word: '', //搜索单词
        bookIds: [],  //用户所有单词本的id
        searchWords:null  //搜索到的单词
      };
    },

    methods: {
      async change() {
        let word = {
          word: this.word,
          bookIds:this.bookIds
        }

        const res = await uni.$myRequest('/home/word/searchWords', 'GET', word)
        this.searchWords=res.data.data
        console.log(this.searchWords, 66)
      }
    },
    onLoad(e) {
      this.bookIds = JSON.parse(e.bookIds) 
      console.log(this.bookIds,1343423)
    }
  }
</script>

<style lang="scss">

</style>
